package cpm.cloud.feign;

import com.test.entities.HandDepartments;
import cpm.cloud.config.FeignConfiguration;
import cpm.cloud.feign.fallback.FeignClientServiceFallBack;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author dell
 * 添加提供方的服务名
 */
@FeignClient(value = "microservice",configuration = FeignConfiguration.class,fallbackFactory = FeignClientServiceFallBack.class)
public interface FeignClientService {

    @RequestMapping("/dept/get/{id}")
    public HandDepartments findById(@PathVariable("id")Long id);

    @RequestMapping("/dept/list")
    public List<HandDepartments> findAll();

    @RequestMapping("/dept/add")
    public HandDepartments add(HandDepartments departments);

    @DeleteMapping("/dept/del/{id}")
    public void delete(@PathVariable("id") Long id);
}
